package com.shop.common.validator.annotation;

import com.shop.common.validator.IdCardValidator;
import org.springframework.validation.annotation.Validated;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = IdCardValidator.class)
@Validated
public @interface IdCard {

    String message() default "身份证号格式不对";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}